package leetcodecompetition.D379;

/**
 * @Author: Siantar
 * @Date: 2024-01-07-11:02
 * @Description: 1.0
 */
public class T100170 {
    public int areaOfMaxDiagonal(int[][] dimensions) {
        int res = 0, max = 0;
        for (int[] d : dimensions) {
            int s = d[0] * d[0] + d[1] * d[1];
            if (s > max) {
                max = s;
                res = d[0] * d[1];
            } else if (s == max) {
                res = Math.max(res, d[0] * d[1]);
            }
        }
        return res;
    }
}
